package cn.edu.ctbu.demo2.repository;

import cn.edu.ctbu.demo2.domain.Score;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface ScoreReporsitory extends JpaRepository<Score,Integer> {
    List<Score> findByNameLike(String name);
    /**
     * 按课程号查找课程成绩
     * @param
     * @return
     */
    @Query(nativeQuery = true,value = "select * from tb_score s where s.no like :no")
    List<Score> findBySno(@Param("no") String no);


}
